<template>
    <div class="setting">
        <div class='moduleHead'>
            <router-link :to="{name:'me'}">
                <span class="back"></span>
            </router-link>
            <span>{{language.setting_title}}</span>
        </div>
        <div class="body">
            <div class="list_warapper ">
                <ul>
                    <li>
                        <router-link :to="{name: 'privacy'} ">
                            <span>{{language.setting_privacy}}</span>
                        </router-link>
                    </li>
                    <li>
                        <router-link :to="{name: 'changeEmail'} ">
                            <span>{{language.setting_changeEmail}}</span>
                        </router-link>
                    </li>
                    <li>
                        <router-link :to="{name: 'changePassword'} ">
                            <span>{{language.setting_changePassword}}</span>
                        </router-link>
                    </li>
                </ul>
            </div>
            <div class="list_warapper">
                <ul>
                    <li>
                        <router-link :to="{name: 'feedback'}">
                            <span>{{language.setting_feedback}}</span>
                        </router-link>
                    </li>
                    <li>
                        <a href="http://www.sugardaddymeet.com/?main=1" target="_blank">
                            <span>{{language.setting_viewFullWebsite}}</span>
                        </a>
                    </li>
                    <li>
                        <router-link :to="{name: 'faq'} ">
                            <span>{{language.setting_HelpFaq}}</span>
                        </router-link>
                    </li>
                    <li @click="loginOut">
                        <!-- <span> Log Out </span> <span class="text_right "></span> -->
                        <span>{{language.setting_logOut}}</span> <span class="text_right ">{{$store.state.user.userInfo.account.username}}</span>
                    </li>
                </ul>
            </div>
            <div class="list_warapper ">
                <ul>
                    <li>
                        <router-link :to="{name: 'about'} ">
                            <span> {{language.unify_about}} </span>
                        </router-link>
                    </li>
                </ul>
            </div>
        </div>
        <publicDialog :props="dialogData"></publicDialog>
        <loading :props="{show:loadingAjax,type:'page'}"></loading>
    </div>
</template>
<script>
import publicDialog from './PublicDialog'
import loading from './Loading'

export default {
    name: 'setting',
    data() {
        return {
            loadingAjax: false,
            dialogData: {},
        }
    },

    components: {
        publicDialog,
        loading,
    },

    activated() {
        this.dialogData = {}
    },

    methods: {

        loginOut() {
            let tthis = this;
            tthis.dialogData = {
                position: 'middle',
                type: 'confirm',
                content: {
                    info: tthis.language.setting_logOutTip,
                },
                callback: function() {
                    tthis.loadingAjax = true;
                    tthis.$store.dispatch('user_loginOut', tthis);
                },
            };
        },
        loginOutCallback() {
            this.loadingAjax = false;
        }
    }
}

</script>
<style scoped>
.setting {
    padding-top: 44px;
    background-color: #efeff4;
}

.setting .list_warapper {
    margin-top: 16px;
    background-color: #fff;
    color: #474747;
    font-size: 16px;
    padding: 0 20px;
    border-top: 1px solid #ebebeb;
    border-bottom: 1px solid #ebebeb;
}

.setting .text_right {
    float: right;
    font-size: 17px;
    padding-right: 16px;
}

.setting .list_warapper li {
    position: relative;
    line-height: 46px;
    border-bottom: 1px solid #e7e8eb;
}

.setting .list_warapper li a {
    display: block;
    color: #474747;
}

.setting .list_warapper li::after,
.setting .list_warapper li::before {
    position: absolute;
    top: 50%;
    right: 2px;
    margin-top: -7px;
    content: '';
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 7px solid #c7c7cc;
}

.setting .list_warapper li::after {
    right: 4px;
    border-left-color: #fff;
}

.setting .list_warapper li:last-child {
    border-bottom: 0;
}

</style>
